// 入口文件

import Vue from 'vue'

//1.1 导入路由包
import VueRouter from 'vue-router'
// 1.2安装路由
Vue.use(VueRouter)

// 定义全局的过滤器
import moment from 'moment'
// 按照：cnpm i moment -S
Vue.filter('dateFormat',function (dateStr,pattern="YYYY-MM-DD HH:mm:ss") {
    return  moment(dateStr).format(pattern)
  })

// 导入Mint-ui
import {Header,Swipe, SwipeItem,Button} from 'mint-ui'
Vue.component(Header.name, Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);
import 'mint-ui/lib/style.css'

// 导入MUI的样式
import '../lib/mui/css/mui.min.css'
import '../lib/mui/css/icons-extra.css'

// 按需导入app跟组件
import app from './app.vue'

// 1.3 导入自己的router.js模块
import router from './router.js'

//2.1导入vue-resource
import VueResource from 'vue-resource'
//2.2安装vue-resource
Vue.use(VueResource)
Vue.http.options.root = 'http://47.89.21.179:8080/';


// 使用aixos
// import Api from './api/axios.js'
// Vue.prototype.$api = Api;
// import Axios from 'axios'
// Vue.prototype.$axios = Axios
// Axios.defaults.baseURL = '/api'
// Axios.defaults.headers.post['Content-Type'] = 'application/json';
// Vue.config.productionTip = false



var vm=new Vue({
    el:'#app',
    render:c=>c(app),
    router//1.4挂载路由对象

})